package com.manage.common;

import javax.servlet.http.HttpServletRequest;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.view.RedirectView;

@Controller
@RequestMapping("/")
public class ForwardController {
	Logger log = LoggerFactory.getLogger(ForwardController.class);
	
	@RequestMapping(value = "/forward")
	public ModelAndView find2Bean(HttpServletRequest request,ModelMap model,@RequestParam("page")String page) {
		log.debug("forward page is: "+page);
		if("".equals(page)){
			return new ModelAndView(new RedirectView("index.html"));
		}
		return new ModelAndView(page,model);
	}
	
}
